<?php 

class label  {


	public function labellist($parm){
		$result = DB::select('*')->from('syslabel')->execute()->as_array();
		return $result;
	}
		public function getLabelByModel($parm){
		$result = DB::select('*')->from('syslabel')->where("model","=",$parm['model'])->execute()->as_array();
		return $result;
	}
	public function add($parm){
		DB::insert("syslabel",array('name','sort','model'))->values(array($parm['name'],$parm['sort'],$parm['model']))->execute();

	}
	public function detail($parm){
		$result = DB::select('*')->from('syslabel')->where("id","=",$parm['id'])->execute()->as_array();
		return $result;
	}
	public function update($parm){

		DB::update("syslabel")->set(array('name'=>$parm['name'],'sort'=>$parm['sort']))->where('id','=',$parm['id'])->execute();
	}
}